package com.cy.ragbase;

import com.cy.ragbase.rag.CodeRagMcpService;

import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class RagBaseApplication {

    public static void main(String[] args) {
        SpringApplication.run(RagBaseApplication.class, args);
    }

    /**
     * 注册代码RAG工具
     */
    @Bean
    public ToolCallbackProvider codeRagTools(CodeRagMcpService codeRagMcpService) {
        return MethodToolCallbackProvider.builder()
                .toolObjects(codeRagMcpService)
                .build();
    }

}
